package com.muk.webframework.framework.log;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

public class LoggerFile {
	static Logger logger = Logger.getLogger("meis");
	static FileHandler fh;
	
	public static void log(String msg){
		logger.log(Level.INFO,msg);
	}
	
	

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Logger logger = Logger.getLogger("meis");
		
		FileHandler fh;

		try {

			// This block configure the logger with handler and formatter
//			fh = new FileHandler("c:\\MyLogFile.log", true);
//			logger.addHandler(fh);
//			logger.setLevel(Level.ALL);
//			SimpleFormatter formatter = new SimpleFormatter();
//			fh.setFormatter(formatter);

			// the following statement is used to log any messages
			logger.log(Level.INFO, "My first log");
			logger.log(Level.INFO, "test2");
		} catch (SecurityException e) {
			e.printStackTrace();
		} 
//		catch (IOException e) {
//			e.printStackTrace();
//		}

	}

}
